#include <glad/glad.h>
#include <GLFW/glfw3.h>
#include <iostream>
#include <assert.h>

void checkError(const std::string&& message) {
    GLenum err = glGetError();
    if (err != GL_NO_ERROR)
    {
        switch (err)
        {
        case GL_INVALID_ENUM: std::cout << message << ": INVALID_ENUM" << std::endl; break;
        case GL_INVALID_VALUE: std::cout << message << ": INVALID_VALUE" << std::endl;break;
        case GL_INVALID_OPERATION: std::cout << message << ": INVALID_OPERATION" << std::endl;break;
        case GL_OUT_OF_MEMORY:std::cout << message << ":OUT_OF_MEMORY" << std::endl; break;
        default:std::cout << message << ": UNKNOWN ERROR, code=" << err << std::endl; break;
        }
        assert(false);
    }
}